<template>
  <div class="page_addNotAuthShare">

    <van-search
      v-model="inputValue"
      show-action
      placeholder="搜索、添加不让谁转发"
      @search="onSearch"
      @cancel="onCancel"
      @clear="clearInputVal"
      autofocus
      @input="handleInputSearch"
    >
      <template #left>
        <div class="van-search__action" @click="onCancel">取消</div>
      </template>
      <template #action>
        <div @click="handleInputSearch">搜索</div>
      </template>
    </van-search>
  



    <com-multiple-checkbox-card
      v-if="addNotAuthShareDataArr.length"
      :dataList="addNotAuthShareDataArr"
      :actionType="'add'"
      :keyWord="'shareOrNot'"
    ></com-multiple-checkbox-card>

    <van-divider style="margin-top: 80px" v-else>暂无数据</van-divider>






  </div>
</template>

<script>
  import comMultipleCheckboxCard from './common/comMultipleCheckboxCard';

  export default {
    name: 'addNotAuthShare',
    components: {
      comMultipleCheckboxCard,
    },

    data(){
      return {
        inputValue: '',
        addNotAuthShareDataArr: [],

      }
    },

    methods: {
      onSearch(val) {
        console.log('点击回车', val)
        this.addNotAuthShareDataArr = [
          {
            id: 'a',
            name: '华为技术有限公司2333',
          },
          {
            id: 'b',
            name: '深圳市富康网络科技公司4666',
          },
          {
            id: 'c',
            name: '富康网络科技公司789',
          },
        ];
      },
      handleInputSearch(val) {
        if (val){
          console.log('不断输入', val)
          this.addNotAuthShareDataArr = [
            {
              id: 'a',
              name: '华为技术有限公司2333',
            },
            {
              id: 'b',
              name: '深圳市富康网络科技公司4666',
            },
            {
              id: 'c',
              name: '富康网络科技公司789',
            },
          ];
        }
      },
      onCancel() {
        this.$router.push('/myCompany/notAuthShare')
      },

      clearInputVal(){
        this.addNotAuthShareDataArr = [];
      },
    },

  }
</script>

<style lang="scss" scoped>
  .page_addNotAuthShare{
    width: 100%;
    box-sizing: border-box;
  }
</style>
